package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.OuterClassBytecodeEvent;

public class OuterClassBytecodeEventImpl extends BytecodeEventImpl implements OuterClassBytecodeEvent
{
    private String enclosingClassName;
    private String methodName;
    private String methodDescriptor;

    public OuterClassBytecodeEventImpl(final String aEnclosingClassName, final String aMethodName,
        final String aMethodDescriptor)
    {
        enclosingClassName = aEnclosingClassName;
        methodName = aMethodName;
        methodDescriptor = aMethodDescriptor;
    }

    @Override
    public int getType() {
        return OUTER_CLASS;
    }

    @Override
    public String getEnclosingClassName() {
        return enclosingClassName;
    }

    @Override
    public void setEnclosingClassName(final String aEnclosingClassName) {
        enclosingClassName = aEnclosingClassName;
    }

    @Override
    public String getMethodName() {
        return methodName;
    }

    @Override
    public void setMethodName(final String aMethodName) {
        methodName = aMethodName;
    }

    @Override
    public String getMethodDescriptor() {
        return methodDescriptor;
    }

    @Override
    public void setMethodDescriptor(final String aMethodDescriptor) {
        methodDescriptor = aMethodDescriptor;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        aBytecodeVisitor.asBytecodeClassVisitor().visitOuterClass(this);
        return aBytecodeVisitor;
    }
}
